 @set @jscript=1/*
 @echo off&color 0b&set cd /d=%~dp0&mode con: cols=73 lines=6&&title[~ REPLACE TIMEDATE.CPL ~]

:: ### ADMIN CHECK
 reg query "hku\S-1-5-19" >nul 2>&1 || (
    @cscript //e:jscript //nologo "%~f0" "%~f0"
    goto :eof
 )

echo Please SAVE ALL OPEN WORK before continuing.
PAUSE
 
 :: ### VARIABLES
set srv=sppsvc
set cpy=xcopy /qy
set file0=explorer.exe
set file1=timedate.cpl
set path1=%windir%\system32
set path2=%systemdrive%

 :: ### OWNERSHIP OF TIMEDATE.CPL
takeown /a /f %path1%\%file1%>nul&icacls %path1%\%file1% /Grant *S-1-5-32-544:F>nul

 :: ### CHECK THEN STOP THE FILE PROTECTION SERVICE IF RUNNING
echo. Stopping The Software Protection Service and Explorer.exe..
sc query %1 | find "%srv%">nul 2>&1 
if not .%errorlevel%.==.1. goto disableservice
::(If already disabled then goto begin)
goto begin
:disableservice
taskkill /f /im %srv% /t>nul 2>&1&timeout /t 2 > nul
sc config %srv% start=disabled>nul 2>&1&net stop %srv%>nul 2>&1
goto begin

:begin
:: ### KILL SERVICE EXPLORER.EXE
taskkill /f /im %file0%>nul
timeout /t 2 /nobreak>nul

 :: ### MOVE THEN RENAME TIMEDATE.CPL FIRST
move "%path1%\%file1%" "%tmp%\">nul&ren "%tmp%\timedate.cpl" "timedate.cpl.bak"
move "%tmp%\timedate.cpl.bak" "%path1%\">nul

 :: ### COPY PATCHED TIMEDATE.CPL
%cpy% "%~dp0timedate.cpl" "%path1%\">nul

 :: ### RESTORE OWNERSHIP
cls
echo. Modifying and Replacing System Files..Resetting Permissions
icacls "%path1%\%file1%" /setowner "NT Service\TrustedInstaller" /T /C>nul 2>&1
timeout /t 2 /nobreak>nul

 :: ### RESTART APPLICATIONS & SERVICES
net start %srv%>nul
cls
echo. Almost Done!..Restarting Software Protection Service and Explorer.exe..
timeout /t 3 /nobreak>nul
net start %srv%>nul
start %file0%&exit /b

:eof
 // ### RUN AS ADMINISTRATOR
 */
 var strArg = WScript.Arguments(0);
 var objSH = WScript.CreateObject("Shell.Application");
 objSH.ShellExecute(strArg, "", "", "runas", "5");